Skip to content

Update uuid library#124

Open
pzentenoe wants to merge 9 commits intosatori:masterfrom
pzentenoe:master
Open

Update uuid library#124
pzentenoe wants to merge 9 commits intosatori:masterfrom
pzentenoe:master

Conversation

@pzentenoe
Copy link
Copy Markdown

Pull Request Summary

This Pull Request introduces a series of improvements and updates to the UUID library, including new functionality, code refactoring, and modernization of the tests. Below are the main changes:

Implementation Changes

  1. UUID V6 and V7 Implementation:

    • Added NewV6 and NewV7 methods to the Generator interface and their respective implementations in rfc4122Generator.
    • UUID V6: Reorders time fields to allow lexicographically sortable UUIDs based on time.
    • UUID V7: Utilizes a Unix timestamp combined with random data to generate chronologically sortable UUIDs.
  2. Refactoring of Existing Methods:

    • Improved clarity and robustness of key methods like SetVersion, SetVariant, Must, and others.
    • Added detailed GoDoc comments to enhance code understanding.
  3. Enhancements in SQL Interoperability:

    • Revised and optimized the Scan and Value methods for UUID and NullUUID, ensuring clearer and more robust handling of data in SQL interactions.

Test Updates and Modernization

  1. Migration to Testify:

    • Refactored all existing tests to use testify, improving readability and the effectiveness of assertions.
    • Removed outdated dependencies like gopkg.in/check.v1, adopting a more standard approach with testing and testify.
  2. New Tests for UUID V6 and V7:

    • Added unit tests and benchmarks for NewV6 and NewV7, ensuring their correct functionality and performance.
  3. Optimization of Existing Tests:

    • Enhanced tests for existing methods such as Bytes, String, Equal, Version, and Variant to ensure complete and accurate coverage.

CI

  • travis removed
  • github action added

Documentation

  • Add badge to readme.

@cameracker
Copy link
Copy Markdown

#103

@cameracker
Copy link
Copy Markdown

Here's a drop in replacement that was forked from this library that already has most (all) of the feature's you've incorporated. We'd welcome some additional contributions.

https://github.com/gofrs/uuid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants